import request from '@/utils/request'
import utils from "../../views/js/index";

// 查询我的退款列表
export function list(query) {
    return request({
        url: '/yzxmp/orderservice/queryorder',
        method: 'get',
        params: query
    })
}

// 导出查询列表
export function downloadorder(query) {
    request({
        url: '/yzxmp/orderservice/downloadorder',
        method: 'get',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
        params: query,
        responseType: 'blob'
    }).then(res => {
        const content = res;
        const blob = new Blob([content]);
        if ("download" in document.createElement("a")) {
          const elink = document.createElement("a");
          elink.download = `订单-${utils.utils.NewDate()}下载.xlsx`;
          elink.style.display = "none";
          elink.href = URL.createObjectURL(blob);
          document.body.appendChild(elink);
          elink.click();
          URL.revokeObjectURL(elink.href);
          document.body.removeChild(elink);
        } else {
          navigator.msSaveBlob(blob, 'filename');
        }
    })
}



// 分销商列表
// export function querytrader() {
//     return request({
//         url: '/yzxmp/customerservice/querytrader',
//         method: 'get'
//     })
// }

// // 查询订单详情
// export function queryorderdetail(query) {
//     return request({
//         url: '/yzxmp/customerservice/queryorderdetail',
//         method: 'get',
//         params: query
//     })
// }

